package com.hyk.controller;

import com.hyk.dto.ApiResult;
import com.hyk.enums.ApiEnum;
import com.hyk.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: chen
 * @Date: 2021/3/16 2:55 PM
 * @Version 1.0
 */
@Controller
@Api(value = "登录", tags = "登录，注销等操作")
public class LoginController {

    @ResponseBody
    @ApiOperation(value = "swagger端测试注销入口")
    @PostMapping("/logout")
    public ApiResult logout() {
        System.out.println("注销成功!");
        return R.ok(ApiEnum.LOGOUT_OK);
    }

    @ApiOperation(value = "提示跳转到登录页面")
    @GetMapping("/login_p")
    public String loginP() {
        return "/login.html";
    }


//    @ApiOperation(value = "跳转到登录页面")
//    @GetMapping("/login_page")
//    public String loginPage() {
//        return "/login/login.html";
//    }


}
